<?php

$api = app('Dingo\Api\Routing\Router');
$moduleName = 'Payment';

// 平台后台api
$api->version('v1', ['prefix' => 'admin-api', 'namespace' => 'Modules\\'.$moduleName.'\Http\Controllers\Admin\V1'], function ($api) {
	$allMethod = ['index', 'show', 'store', 'update', 'destroy'] ;
});

// 租户api
// $api->version('v1', ['prefix' => 'tenant-api', 'namespace' => 'Modules\\'.$moduleName.'\Http\Controllers\Tenant\V1'], function ($api) {
// 	$allMethod = ['index', 'show', 'store', 'update', 'destroy'];
// });

// 普通用户api
$api->version('v1', ['namespace' => 'Modules\\'.$moduleName.'\Http\Controllers\Client\V1'], function ($api) {
	$allMethod = ['index', 'show', 'store', 'update', 'destroy'];

	$api->post('/payment-callback/wechat/{clientName}/{paySubType}', ['as' => 'payment-callback', 'uses'=> "PaymentCallbackController@wechatpayCallback"]);

	// 抖音支付回调
	$api->post('/payment-callback/byte-dance', ['as' => 'payment-callback', 'uses'=> "PaymentCallbackController@byteDancePayCallback"]);

	// 快手支付回调
	$api->post('/payment-callback/kuaishou', ['as' => 'payment-callback', 'uses'=> "KuaishouCallbackController@pay"]);

	// 支付宝支付
	$api->post('/payment-callback/alipay/{clientName}/{paySubType}', ['as' => 'payment-callback', 'uses'=> "AlipayCallbackController@pay"]);

	// 中金支付回调
	$api->post('/payment-callback/zhongjin', ['as' => 'payment-callback', 'uses'=> "ZhongjinCallbackController@pay"]);

	$api->post('/orders/{uuid}/payment', ['uses' => "PaymentController@detail"]);
	$api->post('/orders/{uuid}/payment-config', ['uses' => "PaymentController@config"]);
});